﻿using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Diagnostics;

namespace SvnLib
{
	/// <summary>
	/// This class is not completed.
	/// </summary>
	public static class SvnHelper
	{
		#region Not used. Maybe we'll need it in the future.

		static public void SvnLook(FileStream fs, string arg, string reposPath, string trxName)
		{
			Process pro = new Process();
			pro.StartInfo.FileName = @"svnlook.exe";
			pro.StartInfo.CreateNoWindow = true;
			pro.StartInfo.RedirectStandardError = true;
			pro.StartInfo.RedirectStandardOutput = true;
			pro.StartInfo.UseShellExecute = false;
			pro.StartInfo.Arguments = arg + " " + reposPath + " -t " + trxName;
			pro.Start();
			pro.WaitForExit();

			WriteFile(fs, "[Output]");
			WriteFile(fs, pro.StandardOutput.ReadToEnd());
			WriteFile(fs, "[Error]");
			WriteFile(fs, pro.StandardError.ReadToEnd());
		}

		public static void WriteFile(FileStream fs, string Info)
		{
			Info += "\r\n";
			byte[] sss = Encoding.ASCII.GetBytes(Info);
			fs.Write(sss, 0, sss.Length);
			fs.Flush();
		}

		#endregion
	}


}
